home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wildcat Gold - The Optical BBS
/
Wildcat Gold - The Optical BBS (The Golden ROM Series)(Volume 4 Number 1)(The Digital Publishing Company)(1992).ISO
/
sdn
/
taskmst.sdn
/
TM480.EXE
/
TMEXAM.EXE
/
BROWSE.TSK
< prev
next >
Wrap
Text File
|
1991-09-10
|
14KB
|
681 lines
; Task details after endtask...
go 1INIT
1READY
dir filespec
if found
go 1FILEGET
1FILEGOT
else
move '1NODEFSET' to cue
insert no_files
go 1OPTION131
1NODEFSET
move '1NODEFSET2' to cue
goto 1FILEGET
1NODEFSET2
fi
move true to init
until forever
move '1PREFILLED' to preback
go 1PREFILL
1PREFILLED
move true to outer_menu
clear newlist
menu 1,'FILELIST',dl
option 1,1,20
move display to dold
trim dold
if not skip
move hilite to main_choice
cursor 2 17 normal 4
cursor 21 17 normal 6
put 'MENU2_HELP' nowait
else
clear bbdisp
fi
clear skip
move ac to choice
move 0ff00h to bbmask
clear outer_menu
menu 2,'ACTIONS_SELECT',cmds
option 2,1,10
move '2RET1TO10' to cue
go 2OPS1TO10
2RET1TO10
dir dold
if not found
move '1CLEARED' to cue
go 1CLEARENT
1CLEARED
cursor row 2 att2 14 normal
go 101RETURN
fi
if not autoreturn
clear bbdisp
return
fi
clear bbdisp
put 'FILELIST_HELP' nowait
exitm
option 2,31
if popop ne 0
popscreen popid
popdown popop
cursor 23 70 attn 1 'Any key' 1 normal
inkey char
popdown popid
popfree popid
fi
move hilite to choice
clear bbdisp
return
option 1,33 ;F3=R-O
option 1,34 ;F4=R/W
move display to dold
trim dold
option 2,33 ;F3=R-O
option 2,34 ;F4=R/W
if choice = 34
attrib set rw dold
else
attrib set ro dold
fi
move hilite to choice
clear bbdisp
return
option 1,35 ;F5=Delete
move display to dold
trim dold
option 2,35 ;F5=Delete
cursor 16 18 normal cel attn
find banned sw dold
if not found
ask sure 'Erase ' dold ', are you sure? (Type Y/N then <return>)'
else
clear sure
fi
if sure
erase dold
dir dold
if found
cursor 16 18 normal cel attn 'Sorry: unable to erase ' dold ' (perhaps protected!)' normal
move hilite to choice
inkey char
if char = zero
inkey
fi
cursor 16 18 normal cel
return
else
move '1CLEARED2' to cue
go 1CLEARENT
1CLEARED2
cursor row 2 att2 14 normal
fi
else
cursor 16 18 normal cel
move hilite to choice
return
fi
cursor 16 18 normal cel
if not newlist
go 101RETURN
fi
exitm
option 2,36 ;F6=Copy
option 2,37 ;F7=Move
move hilite to ac
go 1F6F7
option 1,36 ;F6=Copy
option 1,37 ;F7=Move
move hilite to main_choice
move display to dold
trim dold
1F6F7
fieldfill dest
put 'WHERE_TO' noclear ul
get dest
cursor 23 0 normal cel
if anyfk
move hilite to choice
clear bbdisp
put 'RE_USE' nowait
return
fi
put 'RE_USE' nowait
combine 'copy ' dold 1 dest into cmd
move '2RETCMD' to cue
go 1RUNCMD
2RETCMD
if choice = 37
go 37CHOICE
37RETURN
fi
move hilite to ac
if not newlist
go 2POPFREE
fi
exitm
option 2,30
clear bbdisp
put 'FILELIST_HELP' nowait
exitm
option 2,32
go 101RETURN
endm 2
move main_choice to choice
move true to bbdisp
exitm
option 1,31
move '1RETURN131' to cue
go 1OPTION131
1RETURN131
move "1RESUME" to cue
GOTO 1FILEGET
1RESUME
exitm
option 1,30
append 12 to filespec
save savename dest path filespec cmds autoreturn
if resp ne 0
displayln 'BROWSE: Unable to store defaults in ' savename
else
save
fi
stop
option 1,43
if twenty_count ne 0
decrement twenty_count
fi
exitm
option 1,44
if last_file >= 20
increment twenty_count
fi
exitm
endm 1
fi
stop
37CHOICE
;wait 'in 37choice'
if elevel = 0
find banned sw dold
if not found
erase dold
fi
dir dold
if found
cursor 16 18 normal cel attn 'Sorry - unable to erase ' dold ' (perhaps protected!)' normal
inkey char
if char = zero
inkey
fi
cursor 16 18 normal cel
else
move '1CLEARED3' to cue
go 1CLEARENT
1CLEARED3
;wait 'at 1cleared - was popdown popid here!'
; popdown popid
; popfree popid
cursor row 2 att2 14 normal
if not newlist
go 101RETURN
clear bbdisp
fi
fi
fi
goback 37RETURN
101RETURN
;wait 'in 101RETURN'
if not outer_menu
increment main_choice
if main_choice > 20
move 1 to main_choice
fi
fi
move main_choice to i
decrement i
clear live_entry
until live_entry
if entry i of dl sw ' '
increment i
if i = 20
clear i
fi
else
move true to live_entry
fi
fi
increment i
move i to main_choice
move main_choice to choice
if outer_menu
clear bbdisp
return
else
move hilite to ac
move true to skip
return 101
fi
1POPFREE
;wait 'in popfree'
popdown popid
popfree popid
2POPFREE
move hilite to choice
clear bbdisp
return
1CLEARENT
;wait 'in 1clearent'
find fns sw dold
if found
move spaces to entry row of fns
fi
find dl sw dold
if found
move spaces to entry row of dl
decrement live_entries
add 2 to row
fi
if live_entries = 0
clear init
move cue to savecue2
move '1REFRESH' to cue
go 1OPTION131
1REFRESH
move '2FILEGOT' to cue
go 1FILEGET
2FILEGOT
move 1 to main_choice
move savecue2 to cue
fi
goback cue
1FILEGET
if path ne opath or filespec ne ofilespec
display 'Reading filelist.'
dir filespec
clear fns twenty_count count last_file
until not found or count = 512
increment last_file
setscan display 30
clear fn
scan fn
if fn ct null
sizevar fn fcol
fi
move fn to entry count of fns
if count < 20
move fn to entry count of dl
fi
display '.'
dir
fi count
move true to bbdisp
move true to newlist
move found to extras
fi
display cls
put 'FILELIST_HELP' nowait
move path to opath
move filespec to ofilespec
trim opath ofilespec
goback cue
1OPTION131
move 255 to resp
clear found
until resp = 0 and found
move autoreturn to ar
fieldfill path filespec cmds ar
display cls
put 'PATH_SPEC'
if funkey = 10
if init
put 'FILELIST_HELP' sw 2 nowait
return
else
stop
fi
fi
get path filespec
clear count
until count = 10
get entry count of cmds
fi count
get autoreturn
trim path filespec
upper path
user path
if path sw '\'
else
select path
fi
dir filespec
if not found
insert no_files
fi
fi
GOBACK cue
2OPS1TO10
move choice to ac
move display to cmd
trim cmd
append 1 dold to cmd
1RUNCMD
popscreen popid ;save current screen...
display normal cls
clear found
upper cmd
if cmd sw 'SCR '
if dold ct '.MAC' or dold ct '.TSK'
find banned sw dold
else
move true to found
fi
fi
if found
displayln 'Not appropriate to run SCR on this file'
move 255 to elevel
else
run cmd
fi
if elevel ne 0
cursor 23 70 attn 1 'Any key' 1 normal
inkey char
fi
if popop ne 0 ;popop saves op
popfree popop ;if already used; clear first
fi
popscreen popop ;saved app. output
;wait 'about to popdown popid'
popdown popid ;restore main display
popfree popid ;give back the ram
goback cue
1PREFILL
move twenty_count to first_entry
multiply first_entry by 20
add 20 to first_entry giving last_entry
move first_entry to i
clear count live_entries dl
until count = 20
if entry i of fns ne spaces
move entry i of fns to entry count of dl
increment live_entries
fi
increment i
fi count
if twenty_count ne 0
move 0df04h to bbmask ;esc, f1, and PgUp
cursor 2 17 attn 'PgUp' normal
else
move 0df00h to bbmask ;esc and f1 only
cursor 2 17 normal 4
fi
if last_entry < last_file ;more to display
add 02h to bbmask ;PgDown
cursor 21 17 attn 'PgDown' normal
else
cursor 21 17 normal 6
fi
goback PREBACK
1INIT
define rw,0
define ro,1
define main_choice,1
vconst cls,11
vconst cel,55
vconst normal,5
vconst att2,71
vconst attn,79
logical autoreturn
logical extras
logical forever
logical init
logical live_entry
logical newlist
logical outer_menu
logical skip
logical sure
hexvar null,00
int ac
int count
int first_entry
int last_file
int live_entries
int i
int j
int last_entry
int offset
int popid
int popop
int twenty_count
var ar,1
var banned,12,occurs 2,
'BROWSE.TSK '
'OVERVIEW.MAC'
var char,1
var cmd,50
var cmds,9,occurs 10,
'list '
'scr '
'tm '
var cue,10,"1FILEGOT"
var dest,40
var preback,10
var savecue,10
var savecue2,10
var dl,13,occurs 20
var dold,12
var fn,13,'BROWSE'
var fns,13,occurs 512
var filespec,12,'*.tsk'
var ofilespec,12
var fmpdir,30,$FMPDIR
var no_files,23,'No matching files found'
var nothing,1
var path,50
var opath,50
var savename,40
var formsname,40
end
if fmpdir = nothing
move '\fmp' to fmpdir
fi
forms logon.ovr
display cls
combine fmpdir '\browse.ovr' into formsname
replace '\\' of formsname with '\'
dir formsname
if not found
insert fn fn
put "NO_FORMS" ;logon.ovr open already!
stop
fi
combine fmpdir '\browse.tm' into savename
replace '\\' of savename with '\'
dir savename
if found
restore savename dest path filespec cmds autoreturn
if resp ne 0
displayln 'BROWSE: Error during restore from ' savename
wait
stop
else
restore
fi
fi
user path
move true to hide
enable ctrl_c
forms formsname
goback 1READY
endtask
; Title : BROWSE.TSK Last Updated : September 6, 1991
; Author : Steve Johnson - FmP. Version : 1.10
; Purpose : example of the use of Taskmaster DIR command.
; Notes : This is a Shareware Taskmaster task, if it were a PROTEAN task
; : or a Professional Taskmaster task it would be simpler to
; : code and to follow because it could use subtasks...
; Version 1.10
; : Now uses built-in ATTRIB command.
@video
@head left,'Browse Task'
@head right,'Copyright (c) FmP 1991'
@head centre,'Filelist menu'
@nf filelist_help
@col char,cyan,blue
@dim
@banner
@col char,yellow,black
@window line 4,column 55,depth10,width0
@col char,yellow,blue
@window line 5,column 20,depth10,width 37,pattern 176
@bright
@window line 4,column 18,depth10,width 37,pattern 177
Select a file and press
Press F1 to change filelist or
the list of applications that
appear on the next menu. (Also
saves details for next run).
Press <esc> to quit
@use 'F3=Protect F4=UnProtect F5=Delete F6=Copy F7=Move'
@end
@nf re_use
@overlay
@col char,yellow,blue
@bright
@use 'F3=Protect F4=UnProtect F5=Delete F6=Copy F7=Move'
@end
@nf filelist
@col char,yellow,blue
@dim
@window line 2,column2,depth1,width1
@bbmenu cyan,blue
@repeat x20
{012345678901 }
@bright
@end
@nf path_spec
@col page,cyan,blue
@dim
@head centre,'Defaults Edit'
@banner
@acceptfk f10
@path
@str min1
@str min1
@str
@str
@str
@str
@str
@str
@str
@str
@str
@log
@bright
Please supply defaults for Browse:
Path [ ] (must exist)
@dim
(This is the directory where BROWSE will search)
@bright
Filespec [ ] e.g. t*.t?k { }
@dim
(This is the filespec BROWSE will use for that search)
@bright
These are the commands that appear on the second menu:
@repeat x10
[ ]
Autoreturn after
command? [ ]
@colour char,yellow,blue
@dim
@window line13,column22,depth11,width57,pattern176
@bright
@window line12,column20,depth11,width57,pattern177
Use the TAB and BACKTAB (or ) and HOME keys to move
between fields
Use INS and DEL keys to edit at cursor position
Hold CTRL and Press T to clear from cursor to end of
current field
Press F10 to abandon any changes or to save them
@colour char,cyan,blue
@end
@nf actions_select
@col char,cyan,blue
@dim
@head centre,'Actions menu'
@banner
@window line 4,column 18,depth 1,width1
@bbmenu cyan,blue
@repeat x10
{01234567 }
@end
@nf menu2_help
@colour char,cyan,black
@window line 4,column 18,depth 11,width0
@col char,yellow,blue
@window line 5,column 32,depth9,width 37,pattern 176
@bright
@window line 4,column 30,depth9,width 37,pattern 177
Select a command and press
Press <ESC> to quit this menu
Press F1 to see command screen
Press F2 to select next file
@end
@nf clear_menu_2
@dim
@col char,yellow,black
@window line 4,column 20,depth8,width 39
@window line 2,column 28,depth 10,width10
@end
@nf where_to
@acceptfk f10
@path
@col char,yellow,blue
@bright
@win line23,column0,depth1,width0
Destination directory: [ ] (F10=Abandon)
@end
@eof